import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import Login from '../components/Login.vue'
import Welcome1 from '../components/Welcome1.vue'
import Yonghgl from '../components/user/Yonghgl.vue'
import Role from '../components/role/Role.vue'
import Echart from '../components/e-chart/Echart.vue'
import Weather from '../components/e-chart/Weather.vue'
// 导入全局样式表
import '../assets/css/global.css'
// 导入字体图标
import '../assets/font-icon/iconfont.css'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/login' },
    { path: '/login', component: Login }, {
      path: '/home',
      component: Home,
      redirect: '/welcome1',
      children: [
        { path: '/welcome1', component: Welcome1 },
        { path: '/yonghgl', component: Yonghgl },
        { path: '/role', component: Role },
        { path: '/echart', component: Echart },
        { path: '/weather', component: Weather }
      ]
    }
  ]
})

export default router
